package com.Controller;

import com.POJO.Orders;
import com.Service.OrderService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/order")
public class OrdersController {
    @Autowired
    private OrderService orderService;
    @RequestMapping("/showOrders/{id}")
    public String showItem(@PathVariable("id")int id, Model model)
    {
        Orders orders=orderService.findById(id);
        System.out.println(orders);
        model.addAttribute("orders",orders);
        return "success";
    }
}
